package ch.rheintalconnection.sysventory.presentation.panels;



import ch.rheintalconnection.sysventory.businessServices.DataService;
import ch.rheintalconnection.sysventory.businessServices.ScanningService;
import ch.rheintalconnection.sysventory.domain.User;
import ch.rheintalconnection.sysventory.technicalServices.IDataReader;

import com.vaadin.ui.HorizontalLayout;

public class ContentPanel extends HorizontalLayout {

	private static final long serialVersionUID = 3328940299178977290L;

	private ScanPanel scanPanel;
	private SearchPanel searchPanel;
	private StatisticPanel statisticPanel;
	
	
	
	public ContentPanel(ScanningService scanningService, DataService dataService, IDataReader dataReader){
		this.scanPanel = new ScanPanel(scanningService);
		this.searchPanel = new SearchPanel(dataService, dataReader);
		this.statisticPanel = new StatisticPanel(dataReader, dataService);
	}
	
	public void activateScanPanel(){
		this.removeAllComponents();
		this.addComponent(scanPanel);
	}
	
	public void activateScannedComputersPanel() {
		this.removeAllComponents();
		this.addComponent(searchPanel);
	}
	
	public void activateStatisticPanel(){
		this.removeAllComponents();
		this.addComponent(statisticPanel);
	}

	public void setUser(User user){
		scanPanel.setUser(user);
		searchPanel.setUser(user);
		statisticPanel.setUser(user);
	}
}
